package com.mydemo.dubbo.client;

import com.mydemo.dubbo.GreetingsService;
import org.apache.dubbo.config.ApplicationConfig;
import org.apache.dubbo.config.ReferenceConfig;
import org.apache.dubbo.config.RegistryConfig;

public class ClientApp {
    public static void main(String[] args) {
        ReferenceConfig<GreetingsService> referenceConfig = new ReferenceConfig<>();
        referenceConfig.setApplication(new ApplicationConfig("first-dubbo-consumer"));
        referenceConfig.setRegistry(new RegistryConfig("zookeeper://" + "121.40.91.19" + ":2181"));
        referenceConfig.setInterface(GreetingsService.class);
        referenceConfig.setTimeout(100000);
        GreetingsService greetingsService = referenceConfig.get();
        String s = greetingsService.sayHi("test1");
        System.out.println(s);
    }
}
